from flask_script import Manager
from info import create_app, db
from flask_migrate import Migrate,MigrateCommand    # 数据库迁移



"""调用工厂方法 传入不同配置，获取不同app对象 （ofo公司）"""
app = create_app("development")

"""7. 创建manager管理类"""
manager = Manager(app)

"""8. 创建数据库迁移对象"""
Migrate(app, db)

"""9. 添加迁移指令到manager对象中"""
manager.add_command("db", MigrateCommand)

if __name__ == '__main__':
    manager.run()
